package com.xdwanj.service.impl;

import com.xdwanj.dao.CategoryDao;
import com.xdwanj.dao.impl.CategoryDaoImpl;
import com.xdwanj.pojo.Category;
import com.xdwanj.service.CategoryService;

import java.util.ArrayList;
import java.util.List;

public class CategoryServiceImpl implements CategoryService {
    CategoryDao categoryDao = new CategoryDaoImpl();

    @Override
    public List<Category> getCategory(int id) {
        List<Category> categoryList = new ArrayList<>();
        try {
            categoryList = categoryDao.findCategory(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return categoryList;
    }
}
